﻿<!DOCTYPE html>
<html ng-app="PhotoApp">
<head>
  <title>拍照预览</title>
  <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />
  <meta name="renderer" content="webkit" />
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <link href="/favicon.ico" rel="shortcut icon" />
  <script src="/framework/angular-wang-editor/dist/js/lib/jquery-1.10.2.min.js" type="text/javascript"></script>
    
  <link href="/framework/angular-tooltips-master/dist/angular-tooltips.min.css" rel="stylesheet" type="text/css" />
  <script src="/framework/angular.min.js"></script>
  <style type="text/css">
	body{ background-color: #fff; }
.no-border{ border:0!important  }
.container-fluid{margin: 50px;}
.container img{max-height:50px;margin-left: 20px;}
.screenblock{ color: #39f;padding: 5px;cursor: pointer;}

 .tab { width: 100%;border:1px #ddd solid; border-collapse:collapse;border-radius:3px; background: #fff; color: #5b5b5b;margin: 5px auto;border-top-left-radius:1em;border-top-right-radius:1em;border-bottom-right-radius:1em;order-bottom-left-radius:1em; }
 .tab td { border-bottom:1px #ddd solid; padding:10px; }
 .tab .tdshou{padding:5px;}
 .tab th { border-bottom:1px #ddd solid; padding:3px; padding-left:10px; height: 38px; line-height: 38px; font-size: 14px; }
 .tab td a{ color: $maincolor; }
 .tab td a:hover{text-decoration:underline;}
 .tab tr:hover{background:#e5f0f8; } 
 .tab tr:hover td {background:none;}
 
.pagination>li>a:hover, .pagination>li>span:hover, .pagination>li>a:focus, .pagination>li>span:focus {color: #2a6496; background-color: #eee; border-color: #ddd; }
.pagination>li:last-child>a, .pagination>li:last-child>span {border-top-right-radius: 4px;   border-bottom-right-radius: 4px;}
.pagination>li>a, .pagination>li>span {position: relative; float: left; padding: 6px 12px; margin-left: -1px; line-height: 1.42857143; color: #333; text-decoration: none; background-color: #fff; border: 1px solid #ddd; }
.pagination>li { display: inline;}
.page-list {height:55px;position:relative;font-size: 12px;color: #666; clear: both;}
.pagination {display: inline-block; padding-left: 0; margin: 10px 0; border-radius: 4px; }
.page-list .pagination .separate span{cursor: default;}
.page-list .pagination .separate span:hover {background: none;}
.page-list .pagination {float:left;}
.page-list .pagination span {cursor: pointer;}
.page-list .page-total {float:left; margin: 10px 20px 10px 0;}
.page-list .page-total select{box-sizing: border-box;height: 31px; border: 1px solid #ddd;text-align:center}
.page-list .page-total select {width: 50px;border-radius:3px;margin:0 5px;text-align:center}
.pagination>.active>a, .pagination>.active>span, .pagination>.active>a:hover, .pagination>.active>span:hover, .pagination>.active>a:focus, .pagination>.active>span:focus {z-index: 2; color: $maincolor; cursor: default; border-color: $maincolor; }
.page-list .pagination_right{float:right;}
.page-list .pagination_jump{float:left;padding:12px 0; margin-left:20px;}
.page-list .pagination_jump input{width: 50px; border-radius: 3px; box-sizing: border-box; height: 31px; border: 1px solid #ddd; line-height: 31px; margin: 0 5px;text-align: center;}
.page-list  .pagination_btn {border: 1px solid #ddd; margin-top: 11px; padding: 5px 12px; margin-left: 11px; background: #fff;}

.loading_bg{ position: fixed; width: 100%; height: 100%; top: 0;left: 0; background: black;filter:alpha(Opacity=80);-moz-opacity:0.5;opacity: 0.5; z-index: 998 }
.loading{width: 60px;height: 30px;position: fixed;left: 50%;top: 50%;margin-top: -15px;margin-left: -30px;z-index: 99999}
.loading span{display: inline-block;width: 6px;height: 100%;border-radius: 3px;background: #ffc426;-webkit-animation: load 1s ease infinite;}
  </style>
</head>
<body ng-controller="PhotoCtrl" ng-cloak>
<div class="container-fluid" >
<h1 style=" text-align:center;">{{params.paperName}}</h1>
</div>
<div class="container-fluid" style="text-align: center;">
    <input type="text" ng-model="params.searchText" placeholder="请输入用户名称" style="padding: 5px 10px;width: 500px;" />
    <span class="screenblock" ng-click="GetList()">确认筛选</span>
</div>
<div class="container-fluid" style=" background-color: #fff;padding-bottom:10px; ">
 <div class="container" style="position:relative;width: 100%;">
  <loading isloading="Loading" ng-if="Loading"></loading>
    <table class="tab">
                        <thead>
                            <tr>
                                <td>姓名</td>
                                <td>性别</td>
                                <td>账号</td>
                                <td>组织架构</td>
                                <td>成绩</td>
                                <td>考试日期</td>
                                <td>是否合格</td>
                                <td>拍照图片</td>
                            </tr>
                        </thead>
                        <tbody>

                            <!--正文-->
                            <!--遍历开始-->
                            <tr ng-repeat="item in List" ng-if="!Loading">
                                <td ng-bind="item.userinfo.user_Name">姓名</td>
                                <td ng-bind="item.userinfo.user_Sex==0?'女':(item.userinfo.user_Sex==1?'男':'-')">性别</td>
                                <td ng-bind="item.userinfo.user_Account">账号</td>
                                <td ng-bind="item.userinfo.organization_Name"></td>
                                <td ng-bind="item.score">成绩</td>
                                 <td ng-bind="item.scoreTime">时间</td>
                                <td ng-bind="item.ispass==0?'合格':'不合格'">是否合格</td>
                                <td><img ng-repeat="imgobj in item.imgList" ng-src="{{imgobj.facePhoto}}" /></td>
                            </tr>
                        </tbody>
                    </table>
                    <tm-pagination  conf="paginationConf"></tm-pagination>
</div>

</div>
 <script src="/framework/lodash.min.js" type="text/javascript"></script>
    <script src="/framework/restangular/restangular.min.js" type="text/javascript"></script>
    <script src="/framework/angular-toastr/angular-toastr.min.js" type="text/javascript"></script>
    <script src="/framework/angular-toastr/angular-toastr.tpls.min.js" type="text/javascript"></script>    
    <script src="/framework/angular-tooltips-master/dist/angular-tooltips.min.js" type="text/javascript"></script>
    <script src="/system/service/common.js" type="text/javascript"></script>    
    <script type="text/javascript" src="/framework/pagination/tm.pagination1.js"></script>
    <script src="/system/directive/loading.js" type="text/javascript"></script>
    <script type="text/javascript">

        var PhotoApp = angular.module("PhotoApp", ['tm.pagination', 'Common', 'knowledgebaseS', 'loadModule']);

        PhotoApp.run(function ($rootScope, Restangular, sysUserInfo) {
            Restangular.addFullRequestInterceptor(function (element, operation, route, url, headers, params, httpConfig) {
                //这个地方需要把登录得到的token写入到请求数据的头文件中
                var usertoken = sysUserInfo.getuserinfotoken().toString();
                if (usertoken == undefined || usertoken == null || usertoken == "") {
                    sysUserInfo.clearuserinfo();
                }
                return {
                    headers: { "X-Session-Token": usertoken, "Content-Type": "application/x-www-form-urlencoded;charset=utf-8" }
                };
            });
        });

        PhotoApp.controller('PhotoCtrl', ['$scope', '$rootScope', 'sysUserInfo', 'RequestTrainService', 'Msg', function ($scope, $rootScope, sysUserInfo, RTS, Msg) {

            //初始化参数
            $scope.params = {
                paperid: "",
                paperName: "试卷名称",
                orgid: sysUserInfo.getuserinfo().organization_ID,
                searchText: "",
                pageIndex: "1",
                pageSize: "10"

            };

            //查询列表
            $scope.Loading = false;
            $scope.GetList = function () {
                $scope.params.paperid = $scope.QueryString("pid");
                if ($scope.Loading) {
                    Msg.info("正在查询中。。。");
                    return;
                }
                $scope.Loading = true;
                $scope.params.userid = sysUserInfo.getuserinfo().user_ID;
                RTS.paperPhoto($scope.params).then(function (data) {
                    $scope.Loading = false;
                    if (data.errorcode == "0") {
                        $scope.List = data.datas;
                        if ($scope.List != undefined && $scope.List.length > 0) {
                            $scope.params.paperName = $scope.List[0].paperName;
                            $scope.getImg();
                            $scope.paginationConf.totalItems = data.numCount;
                            $scope.paginationConf.currentPage = data.pageIndex;
                        }
                    } else {
                        Msg.error("链接服务器失败！");
                    }
                });
            }

            //获取拍照图片
            $scope.getImg = function () {
                $scope.List.forEach(function (data, index) {
                    RTS.findFaceInfoPage({ xid: $scope.params.paperid, userId: data.userinfo.user_ID, pageSize: 100 }).then(function (response) {
                        $scope.Loading = false;
                        if (response.errorcode == "0") {
                            data.imgList = response.datas;
                        } else {
                            Msg.error("链接服务器失败！");
                        }
                    });
                });
            }
            /*分页*/
            $scope.paginationConf = {
                currentPage: 1,
                totalItems: 0,
                itemsPerPage: 10,
                perPageOptions: [10, 20],
                onChange: function () {
                    if ((parseInt($scope.params.pageIndex) != parseInt($scope.paginationConf.currentPage)) || (parseInt($scope.params.pageSize) != parseInt($scope.paginationConf.itemsPerPage))) {
                        if ($scope.paginationConf.currentPage == 0) { $scope.paginationConf.currentPage = 1; }
                        $scope.params.pageIndex = $scope.paginationConf.currentPage;
                        $scope.params.pageSize = $scope.paginationConf.itemsPerPage;
                        $scope.GetList();
                    }
                }
            };

            $scope.QueryString = function (fieldName) {
                /// <summary>
                ///   获得URL GET参数  
                /// </summary>
                /// <param name="fieldName" type="String">
                ///   参数名
                /// </param>
                /// <returns type="void" />如果不存在返回NULL
                var reg = new RegExp("(^|&)" + fieldName.toLowerCase() + "=([^&]*)(&|$)", "i");
                var r = window.location.search.substr(1).match(reg);
                if (r != null) return unescape(r[2]); return null;
            }
        } ]);
    </script>
    <script src="/system/service/trainpathservice.js" type="text/javascript"></script>

</body>
</html>